home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / sys / RCS / stat.h,v < prev    next >
Text File  |  1992-02-25  |  5KB  |  290 lines

  1. head     1.11;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.11
  10. date     92.02.25.17.08.43;  author rab;  state Exp;
  11. branches ;
  12. next     1.10;
  13.  
  14. 1.10
  15. date     91.12.16.14.02.05;  author rab;  state Exp;
  16. branches ;
  17. next     1.9;
  18.  
  19. 1.9
  20. date     91.06.03.17.26.29;  author kupfer;  state Exp;
  21. branches ;
  22. next     1.8;
  23.  
  24. 1.8
  25. date     90.05.02.16.56.08;  author rab;  state Exp;
  26. branches ;
  27. next     1.7;
  28.  
  29. 1.7
  30. date     89.07.05.21.10.07;  author rab;  state Exp;
  31. branches ;
  32. next     1.6;
  33.  
  34. 1.6
  35. date     88.10.25.17.08.15;  author nelson;  state Exp;
  36. branches ;
  37. next     1.5;
  38.  
  39. 1.5
  40. date     88.08.23.14.48.50;  author douglis;  state Exp;
  41. branches ;
  42. next     1.4;
  43.  
  44. 1.4
  45. date     88.08.07.17.28.00;  author ouster;  state Exp;
  46. branches ;
  47. next     1.3;
  48.  
  49. 1.3
  50. date     88.06.29.14.48.13;  author ouster;  state Exp;
  51. branches ;
  52. next     1.2;
  53.  
  54. 1.2
  55. date     88.06.21.17.21.12;  author ouster;  state Exp;
  56. branches ;
  57. next     1.1;
  58.  
  59. 1.1
  60. date     88.06.21.16.12.54;  author ouster;  state Exp;
  61. branches ;
  62. next     ;
  63.  
  64.  
  65. desc
  66. @@
  67.  
  68.  
  69. 1.11
  70. log
  71. @Add macros to test for sprite-specific objects
  72. @
  73. text
  74. @/*
  75.  * Copyright (c) 1982, 1986 Regents of the University of California.
  76.  * All rights reserved.  The Berkeley software License Agreement
  77.  * specifies the terms and conditions for redistribution.
  78.  *
  79.  *    @@(#)stat.h    7.1 (Berkeley) 6/4/86
  80.  * $Header: /sprite/src/lib/include/sys/RCS/stat.h,v 1.10 91/12/16 14:02:05 rab Exp Locker: rab $
  81.  */
  82.  
  83. #ifndef _STAT
  84. #define _STAT
  85.  
  86. #include <cfuncproto.h>
  87.  
  88. struct    stat
  89. {
  90.     dev_t    st_dev;
  91.     ino_t    st_ino;
  92.     unsigned short st_mode;
  93.     short    st_nlink;
  94.     uid_t    st_uid;
  95.     gid_t    st_gid;
  96.     dev_t    st_rdev;
  97.     off_t    st_size;
  98.     time_t    st_atime;
  99.     int    st_spare1;
  100.     time_t    st_mtime;
  101.     int    st_spare2;
  102.     time_t    st_ctime;
  103.     int    st_spare3;
  104.     long    st_blksize;
  105.     long    st_blocks;
  106.     long    st_serverID;
  107.     long    st_version;
  108.     long    st_userType;
  109.     long    st_devServerID;
  110. };
  111.  
  112. #define    S_IFMT    0170000        /* type of file */
  113. #define    _IFMT    0170000        /* type of file */
  114. #define        S_IFDIR    0040000    /* directory */
  115. #define        S_IFCHR    0020000    /* character special */
  116. #define        S_IFBLK    0060000    /* block special */
  117. #define        S_IFREG    0100000    /* regular */
  118. #define        S_IFLNK    0120000    /* symbolic link */
  119. #define        S_IFSOCK 0140000/* socket */
  120. #define        S_IFIFO    0010000    /* fifo */
  121. /* Extra Sprite types */
  122. #define        S_IFPDEV 0150000 /* pseudo-device */
  123. #define        S_IFRLNK 0160000 /* remote link */
  124. #define    S_ISUID    0004000        /* set user id on execution */
  125. #define    S_ISGID    0002000        /* set group id on execution */
  126. #define    S_ISVTX    0001000        /* save swapped text even after use */
  127. #define    S_IREAD    0000400        /* read permission, owner */
  128. #define    S_IWRITE 0000200    /* write permission, owner */
  129. #define    S_IEXEC    0000100        /* execute/search permission, owner */
  130.  
  131. #define S_ISBLK(m)      (((m)&_IFMT) == S_IFBLK)
  132. #define S_ISCHR(m)      (((m)&_IFMT) == S_IFCHR)
  133. #define S_ISDIR(m)      (((m)&_IFMT) == S_IFDIR)
  134. #define S_ISFIFO(m)     (((m)&_IFMT) == S_IFIFO)
  135. #define S_ISREG(m)      (((m)&_IFMT) == S_IFREG)
  136. #ifndef _POSIX_SOURCE
  137. #define S_ISLNK(m)      (((m)&_IFMT) == S_IFLNK)
  138. #define S_ISSOCK(m)     (((m)&_IFMT) == S_IFSOCK)
  139. /* Extra Sprite tests */
  140. #define S_ISPDEV(m)     (((m)&_IFMT) == S_IFPDEV)
  141. #define S_ISRLNK(m)     (((m)&_IFMT) == S_IFRLNK)
  142. #endif
  143.  
  144. /*
  145.  * User-defined file types.  A number of types are standardized, but others
  146.  * may be defined by the user.
  147.  *
  148.  *     S_TYPE_UNDEFINED    - no type set
  149.  *     S_TYPE_TMP          - temporary file
  150.  *     S_TYPE_SWAP         - swap file
  151.  *     S_TYPE_OBJECT       - ".o" file
  152.  *     S_TYPE_BINARY       - executable
  153.  *     S_TYPE_OTHER       - file that doesn't correspond to any
  154.  *                  specific type.  This is distinct
  155.  *                  from undefined, which says the type
  156.  *                  is uninitialized and may be inferred
  157.  *                  by parent directory or file name.
  158.  */
  159. #define S_TYPE_UNDEFINED 0
  160. #define S_TYPE_TMP 1
  161. #define S_TYPE_SWAP 2
  162. #define S_TYPE_OBJECT 3
  163. #define S_TYPE_BINARY 4
  164. #define S_TYPE_OTHER 5
  165.  
  166. extern int fstat _ARGS_((int fd, struct stat *buf));
  167. extern int lstat _ARGS_((char *path, struct stat *buf));
  168. extern int stat _ARGS_((char *path, struct stat *buf));
  169.  
  170. extern int mkdir _ARGS_((char *path, int mode));
  171.  
  172. #endif /* _STAT */
  173. @
  174.  
  175.  
  176. 1.10
  177. log
  178. @Added the definition for S_ISBLK, and a few others.
  179. @
  180. text
  181. @d7 1
  182. a7 1
  183.  * $Header: /sprite/src/lib/include/sys/RCS/stat.h,v 1.9 91/06/03 17:26:29 kupfer Exp Locker: rab $
  184. d40 1
  185. d66 3
  186. @
  187.  
  188.  
  189. 1.9
  190. log
  191. @Add a prototype for mkdir().  Add prototype information to the
  192. declarations of stat, lstat, and fstat.
  193. @
  194. text
  195. @d7 1
  196. a7 1
  197.  * $Header$
  198. d56 11
  199. @
  200.  
  201.  
  202. 1.8
  203. log
  204. @Added declarations for stat(), fstat() and lstat().
  205. @
  206. text
  207. @d7 1
  208. d13 2
  209. d78 5
  210. a82 3
  211. extern int fstat();
  212. extern int lstat();
  213. extern int stat();
  214. @
  215.  
  216.  
  217. 1.7
  218. log
  219. @*** empty log message ***
  220. @
  221. text
  222. @d74 5
  223. @
  224.  
  225.  
  226. 1.6
  227. log
  228. @Added device server ID.
  229. @
  230. text
  231. @d74 1
  232. a74 1
  233. #endif _STAT
  234. @
  235.  
  236.  
  237. 1.5
  238. log
  239. @Added #defines for user file types (S_TYPE_* instead of FS_USER_TYPE_*).
  240. @
  241. text
  242. @d33 1
  243. @
  244.  
  245.  
  246. 1.4
  247. log
  248. @Rename fields for consistency.
  249. @
  250. text
  251. @d52 21
  252. a72 1
  253.  
  254. @
  255.  
  256.  
  257. 1.3
  258. log
  259. @Add ifdefs to prevent files from being included multiple times.
  260. @
  261. text
  262. @d30 3
  263. a32 3
  264.     long    serverID;
  265.     long    version;
  266.     long    userType;
  267. @
  268.  
  269.  
  270. 1.2
  271. log
  272. @Add back in Sprite types.
  273. @
  274. text
  275. @d9 3
  276. d30 3
  277. a32 1
  278.     long    st_spare4[2];
  279. d52 2
  280. @
  281.  
  282.  
  283. 1.1
  284. log
  285. @Initial revision
  286. @
  287. text
  288. @d37 4
  289. @
  290.